package com.lyz.dataStructure.algorithm.百度2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 20:30
 * @Description:
 **/

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/10 20:30
 *@Description:
 **/

/*
3 51
100 1
50 4
1 2

4
 */
public class 发工资 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt(),m =sc.nextInt();
        int [][] dp =new int[n][2];
        for(int i =0;i<n;i++){
            dp[i][0] =sc.nextInt();
            dp[i][1] = sc.nextInt();
        }
        int count = 0;

        for(int i =0;i<n;i++){
           if(dp[i][0]>m){
               count +=dp[i][1];
               dp[i][0] = 0;
           }
        }
        int temp = 0;
        for(int i =0;i<n;i++){
            if(dp[i][0]!=0){
                int ss = dp[i][0]*dp[i][1];
                temp+=ss;
            }
        }
        int sub = temp/m;
        count+=sub;
        System.out.println(count);
    }

}
